﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Lekker.Data.Recipes;
using Microsoft.Practices.Unity;
using Lekker.Data.Model;

namespace Lekker.Services.Recipes {
    public class RecipeService : IRecipeService {

        /*---------------------------------------------------------------------------------------*/
        #region Properties

        [Dependency]
        public IRecipeDao RecipeDao { get; set; }

        #endregion
        /*---------------------------------------------------------------------------------------*/

        /*---------------------------------------------------------------------------------------*/
        #region IRecipeService Members

        public IEnumerable<Recipe> GetRecipes() {
            return this.RecipeDao.GetRecipes();
        }

        public IEnumerable<Recipe> GetRecentRecipes() {
            return this.RecipeDao.GetRecentRecipes();
        }

        public IEnumerable<GuestMenu> GetRecentGuestMenus() {
            return this.RecipeDao.GetRecentGuestMenus();
        }

        public Recipe GetRecipe(int id) {
            return this.RecipeDao.GetRecipe(id);
        }

        public void UpdateRecipe(Recipe recipe) {

            if (recipe == null)
                throw new ArgumentNullException("recipe","Argument is not allowed to be null.");

            this.RecipeDao.UpdateRecipe(recipe);
        }

        #endregion
        /*---------------------------------------------------------------------------------------*/

    }
}
